home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/math,v $
- * $Date: 1996/10/30 21:58:58 $
- * $Revision: 1.2 $
- * $State: Rel $
- * $Author: unixlib $
- *
- * $Log: math,v $
- * Revision 1.2 1996/10/30 21:58:58 unixlib
- * Massive changes made by Nick Burret and Peter Burwood.
- *
- * Revision 1.1 1996/04/19 21:02:57 simon
- * Initial revision
- *
- ***************************************************************************/
-
- /* ANSI Standard 4.5: Mathematics <math.h>. */
-
- #ifndef __MATH_H
- #define __MATH_H
-
- #ifndef __FLOAT_H
- #include <float.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #define HUGE_VAL DBL_MAX
-
- /* Trigonometric functions. */
-
- /* Arc cosine of x. */
- extern double acos (double x);
- /* Arc sine of x. */
- extern double asin (double x);
- /* Arc tangent of x. */
- extern double atan (double x);
- /* Arc tangent of y/x. */
- extern double atan2 (double y,double x);
-
- /* Cosine of x. */
- extern double cos (double x);
- /* Sine of x. */
- extern double sin (double x);
- /* Tangent of x. */
- extern double tan (double x);
-
- /* Hyperbolic functions. */
-
- /* Hyperbolic cosine of x. */
- extern double cosh (double x);
- /* Hyperbolic sine of x. */
- extern double sinh (double x);
- /* Hyperbolic tangent of x. */
- extern double tanh (double x);
-
- /* Exponential and logarithmic functions. */
-
- /* Exponentional function of x. */
- extern double exp (double x);
- /* Break value into a normalized fracton and an integral power of 2. */
- extern double frexp (double value, int *exp);
- /* x times (two to the exp power). */
- extern double ldexp (double x,int exp);
- /* Natural logarithm of x. */
- extern double log (double x);
- /* Base-ten logarithm of x. */
- extern double log10 (double x);
- /* Break value into integral and fractional parts. */
- extern double modf (double value, double *iprt);
-
- /* Power functions. */
-
- /* Return x to the y power. */
- extern double pow (double x, double y);
- /* Return the square root of x. */
- extern double sqrt (double x);
-
- /* Nearest integer, absolute value, and remainder functions. */
-
- /* Smallest integral value not less than X. */
- extern double ceil (double x);
- /* Absolute value of X. */
- extern double fabs (double x);
- /* Largest integer not greater than X. */
- extern double floor (double x);
- /* Floating-point modulo remainder of X/Y. */
- extern double fmod (double x, double y);
-
- /* BSD useful constants. */
- #define M_E 2.7182818284590452354 /* e */
- #define M_LOG2E 1.4426950408889634074 /* log 2e */
- #define M_LOG10E 0.43429448190325182765 /* log 10e */
- #define M_LN2 0.69314718055994530942 /* log e2 */
- #define M_LN10 2.30258509299404568402 /* log e10 */
- #define M_PI 3.14159265358979323846 /* pi */
- #define M_PI_2 1.57079632679489661923 /* pi/2 */
- #define M_PI_4 0.78539816339744830962 /* pi/4 */
- #define M_1_PI 0.31830988618379067154 /* 1/pi */
- #define M_2_PI 0.63661977236758134308 /* 2/pi */
- #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
- #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
- #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-